package org.xg.study.pd.test;

import org.junit.Test;
import org.xg.study.pd.StoreFactory;
import org.xg.study.pd.store.ICommodity;

import java.util.HashMap;
import java.util.Map;

/**
 * @author CMG
 * @version 1.0
 * @cLassName Api1_02Test
 * @description
 * @date 2021/9/9 9:54
 **/
public class ApiTest1_02 {

    @Test
    public void test_commodity() throws Exception {
        StoreFactory storeFactory = new StoreFactory();

        //1优惠券
        ICommodity commodityService = storeFactory.getCommodityService(1);
        commodityService.sendCommodity("10001", "EGM1023938910232121323242", "791098764902132", null);

        //2实物商品
        ICommodity commodityService1 = storeFactory.getCommodityService(2);
        commodityService1.sendCommodity("10001", "9820198721311", "1023000020112221113", new HashMap<String, String>() {{
            put("consigneeUserName", "谢飞机");
            put("consigneeUserPhone", "15200292123");
            put("consigneeUserAddress", "吉林省.长春市.双阳区.XX街道.檀溪苑小区.#18-2109");
        }});

        //3第三方兑换卡（爱奇艺）
        ICommodity commodityService2 = storeFactory.getCommodityService(3);
        commodityService2.sendCommodity("10001", "AQY1xjkUodl8LO975GdfrYUio", null, null);
    }
}
